import { keys } from 'lodash'
import Vue from 'vue'

const path = require('path')
const contexts = require.context('./', true, /\.vue$/)

contexts.keys().forEach(key => {
  if (!key.includes('component')) {
    const name = path.basename(key, '.vue')
    Vue.component(name, contexts(key).default || contexts(key))
  }
})
